import axios from 'axios'
//名片初始化
export function editInit(data) {
  const url = baseURL + 's=UpdateCard/cardInit'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}
//名片编辑初始化
export function cardEditInit(data){
  const url = baseURL + 's=UpdateCard/editInit'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}
//名片提交
export function editSubmit(data) {
  const url = baseURL + 's=UpdateCard/edit'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}
//生成名片
export function CreateCardPictrue(data){
  const url = baseURL+'s=Show/CreateCardPictrue'
  return axios.post(url,data,{
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res=>{
    return res.data;
  })
}
//收藏 ---自己的收藏
export function Collect(data) {
  const url = baseURL + 's=UserFavorite/getFavoriteGoods'
  return axios.post(url, data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  }).then(res => {
    return res.data;
  })
}

//收藏 ---别人的收藏
export function otherCollect(data) {
  const url = baseURL + 's=UserFavorite/getOthersFavoriteGoods'
  return axios.post(url, data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  }).then(res => {
    return res.data;
  })
}
